<!--
 * @Author: 'hongjilin' '1044580210@qq.com'
 * @Date: 2022-09-01 11:58:00
 * @LastEditors: 'hongjilin' '1044580210@qq.com'
 * @LastEditTime: 2022-09-03 16:34:33
 * @FilePath: \插件开发\src\views\components\footer-tools.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div class="footer">
    <!-- 此处相对路径要按照index.html为准，而不是当前vue组件的位置 -->
    <div class="footer-img-gotop">
      <img src="./assets/upward.png" alt="返回顶部" @click.stop="handleGoToTop" />
    </div>
    <div class="footer-img-batch-delete" v-if="showbatch">
      <img src="./assets/batchdel.png" alt="批量删除" @click.stop="batchDelete" />
    </div>
    <div class="footer-img-batch-delete" v-if="showbatch">
      <img src="./assets/collector.png" alt="收藏" @click.stop="batchCollector" />
    </div>
    <div class="footer-img-del">
      <img src="./assets/del.png" alt="清空" @click.stop="clearStore" />
    </div>
  </div>
</template>


<script>
module.exports = {
  inject: ['confirmConfig'],
  props: {
    showbatch: {
      type: Boolean,
      default: false
    }
  },
  mounted() {
  },
  methods: {
    //批量删除
    batchDelete() {
      this.confirmConfig({ title: '批量删除', msg: '确定批量删除选中的记录？' }, () => {
        this.$emit('batch-delete')
      })

    },
    //批量收藏
    batchCollector() {
      this.confirmConfig({ title: '批量收藏', msg: '确定批量收藏选中的记录？' }, () => {
        this.$emit('batch-collector')
      })

    },
    //回到顶部
    handleGoToTop() {
      this.$emit('handle-go-top')
    },
    //清空存储的数据
    clearStore() {
      this.$emit('clear-store')

    },
  }

}
</script>
